/*
 * Created on 22-ago-2004
 *
 */
package guru.merlin.core;

import java.io.Serializable;

/**
 * @author cobach
 *
 */
public abstract class Address implements Serializable {

    private String schema;
    private String domain;
    private String port;
    private String local;
    private String anchor;
    private String variable;
    
    protected Address(String schema, String domain, String port, String local){
        this.schema=schema;
        this.domain=domain;
        this.port=port;
        this.local=local;
    }
    
     
    public String toString(){
        StringBuffer sb=new StringBuffer();
                
        if (schema!=null) sb.append(schema+"://");
  
        sb.append(domain);

        if (port!=null) sb.append(":"+port);
        if (local!=null) sb.append("/"+local);
        if (anchor!=null) sb.append("#"+anchor);
        if (variable!=null) sb.append("?"+variable);
     
        return(sb.toString());
    }


    public String getDomain() {
        return domain;
    }




    public void setDomain(String domain) {
        this.domain = domain;
    }




    public String getAnchor() {
        return anchor;
    }




    public void setAnchor(String anchor) {
        this.anchor = anchor;
    }




    public String getLocal() {
        return local;
    }




    public void setLocal(String local) {
        this.local = local;
    }




    public String getPort() {
        return port;
    }




    public void setPort(String port) {
        this.port = port;
    }




    public String getSchema() {
        return schema;
    }




    public void setSchema(String schema) {
        this.schema = schema;
    }

    public String getVariable() {
        return variable;
    }

    public void setVariable(String variable) {
        this.variable = variable;
    }
}
